-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect/bsize: Validate against content buffer when available #5028
Conversation
This commit updates the bsize documentation 1. Describe what happens when "content" immediately precedes "bsize" 2. Include the operators and 3. Include examples using the operators.
This commit causes the signature to be invalid if a content keyword immediately precedes bsize and the bsize value is incompatible with the content length.
This commit adds test cases that validate behavior when "content" immediately precedes "bsize".
Could we use detect-engine-uint.c helper functions ? |
I don't think that would be a benefit in this case. |
|
||
.. container:: example-rule | ||
|
||
alert dns any any -> any any (msg:"test bsize rule"; dns.query; content:"middle"; bsize:5<>15; sid:126; rev:1;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be bsize:6<>15
as length of "middle" is 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does 6<>15
mean ? A range ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -- a range.
Continued in #5576 |
Continuation of #5014
This PR adds additional validation when using the
bsize
keyword. If a one or morecontent
keywords immediately precedesbsize
, then thebsize
value is checked against each to see if a match is possible using the operation (=, <, >, <>
) and the value.An error is raised if
bsize
value prevents a match, e.g., the content length exceeds thebsize
value. Thebsize
operation and values are used to do the evaluation.Link to redmine ticket: 3682
Describe changes:
Companion Suricata PR #233